package net.xiangcaowuyu.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.messaging.Message;

/**
 * 博客：https://www.xiangcaowuyu.net
 * Description:
 *
 * @Author: 香草物语
 * DateTime: 2021-07-25 11:27
 */
@EnableBinding(Sink.class)
@Slf4j
public class MessageListener8803 {

    @Value("${server.port}")
    private String serverPort;

    @StreamListener(Sink.INPUT)
    public void listenerMessage(Message<String> message) {
        log.info("*************接收到消息：" + message.getPayload() + "\t端口号为：" + serverPort);
    }

}
